package com.lanou.dllo.baisibudejie.adapater;

import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter;

import com.lanou.dllo.baisibudejie.fragment.CardFragmentFactory;

/**
 * Created by dllo on 15/10/22.
 */
public class CardAdapter extends FragmentPagerAdapter {

    private String[] titles = {"段子", "图片", "音乐"};


    public CardAdapter(FragmentManager fm) {
        super(fm);
        
    }

    @Override
    public Fragment getItem(int position) {
//        return MyFragment.newInstance(position);

        return CardFragmentFactory.createFragment(position);
    }

    @Override
    public int getCount() {
        return titles.length;
    }

    @Override
    public CharSequence getPageTitle(int position) {


        return titles[position];
    }
}
